package com.cty.Dao.impl;

import com.cty.Dao.StudentDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

@Repository
public class StudentDaoImpl implements StudentDao {
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Override
    public void updateNameById(String name, int id) {
        String sql = "update students set name = ? where id = ?";
        jdbcTemplate.update(sql,name,id);
    }

    @Override
    public void updateAgeById(int Age, int id) {
        String sql = "update students set age = ? where id = ?";
        jdbcTemplate.update(sql,Age,id);
    }
}
